

import engine.initLIB.load_dll as engineLib
import ctypes

import bpy
from bpy.types import Panel, Menu
from rna_prop_ui import PropertyPanel






class C_Engine_更新物体到引擎(bpy.types.Operator):
	bl_idname = 'node.engine_update_object'
	bl_label = '更新物体到引擎'
	bl_options = {'REGISTER', 'UNDO'}
	
	def execute(operator, context):
		
		return {'FINISHED'}





class ObjectButtonsPanel:
	bl_space_type = 'PROPERTIES'
	bl_region_type = 'WINDOW'
	bl_context = "object"


class OBJECT_PT_引擎物体属性(ObjectButtonsPanel, Panel):
	bl_label = "引擎物体属性"
	bl_options = {'DEFAULT_CLOSED'}

	def draw(self, context):
		layout = self.layout
		obj = context.object
		
		layout.label(text=str(obj.m_物体ID))
		if obj.m_物体ID >= 0 :
			layout.operator('node.engine_update_object', text="更新物体", icon="FILE_REFRESH")
			



classes = (
	C_Engine_更新物体到引擎,
	
	OBJECT_PT_引擎物体属性,

)



def register():
	bpy.types.Object.m_物体ID = bpy.props.IntProperty(name='物体ID', min=-1, default=-1)
	
	for c in classes:
		bpy.utils.register_class(c)
		
def unregister():

	for c in classes:
		bpy.utils.unregister_class(c)

	
